import { Controller, Get, Query } from '@nestjs/common';
import { AppService } from './app.service';

@Controller()
export class AppController {
  constructor(private readonly appService: AppService) {}

  @Get()
  getHello(): string {
    return this.appService.getHello();
  }

  // 添加新的GET路由，支持查询参数name
  @Get('greet')
  getGreeting(@Query('name') name: string): string {
    // 如果没有提供name参数，使用默认值'Guest'
    return this.appService.getGreeting(name || 'Guest');
  }
}
